import { request,  } from "vendor/utils/T";
import { toApi } from "@/service/proxyApi"

import { RespDataType, RequestDataType} from "./apiType";
export * from "./apiType";

const { put, get } = request;

/**
 * 获取登录用户信息
 */
export const getLoginUserInfo = () => get<RespDataType.LoginUserInfo>(toApi("api/v1/system/personal/getPersonalInfo"), {}, {isShowErrorPrompt: false});

/**
 * 修改个人信息
 */
export const updatePersonInfo = (params: RequestDataType.UpdatePersonInfoParams) => put(toApi("api/v1/system/personal/edit"), params)

/**
 * 更新用户密码
 */
// export const updatePassword = (oldPassword: string, newPassword: string) => put(toApi(`api/v1/system/personal/resetPwd`), {oldPassword,newPassword});
export const updatePassword = (password: string) => put(toApi(`api/v1/system/personal/resetPwd`), {password});


